if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_DonViQuiDoi_GetAll]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_DonViQuiDoi_GetAll]
GO

CREATE PROCEDURE [sp_DonViQuiDoi_GetAll]
AS
SELECT A.ID,
		A.Don_vi_goc AS 'Don_vi_goc',
		A.So_luong AS 'So_luong',
		A.Child_id,
		B.Don_vi_goc AS 'Don_vi_qui_doi',
		A.Ghi_chu,
		A.Ngay_cap_nhat_cuoi
FROM donviquidoi A
INNER JOIN donviquidoi B ON A.Child_id = B.ID